At present time, as the capacity of data to be processed increases, the necessity for a data recording apparatus that records data on a magnetic tape is increasing. Unlike with a disk type recording medium, data is almost sequentially recorded on a magnetic tape type recording medium.
Now, assume an example that there are two tape streamers and that data is exchanged therebetween (for example, data is copied therebetween). As a prevailing method performed a the present time, data is copied between the two tap streamers through a host computer as shown in FIG. 20. When data is copied from a data recording device (hereinafter referred to as a device) 202 to a device 203, he host computer 200 reads data from the device 20 and stores the data to a buffer memory (not shown) of the host computer 200 through a bus 201. The host computer 200 causes the data stored in the buffer memory to be sent to the device 203 through the bus 201 and then the data to be written to a record medium of the device 203.
As another method, a protocol such as the SCSI system that has a data copy command in the command system is known. When data is copied from a device 206 to a device 205 corresponding to the protocol, as shown in FIG. 21, a host computer 204 causes a copy command to be sent to the device 205 through a SCSI bus 207. The device 205 that has received the copy command sends a read command to the device 206. Thus, data stored in the device 206 is automatically sent to the device 205 through the SCSI bus 207 and then written to a record medium of the device 205.
In the copying method using the host computer, since data is sent through the memory of the host computer, the memory resource of the computer and the CPU resource for data input/output commands are wasted. In addition, since data flows in the bus twice, the transmission rate of the data becomes around 1/2. Moreover, since the process speeds of the devices are satisfactorily high, the process speeds of data that is input/output to/from the host computer affect the data transmission speeds.
Furthermore, data is sent with an unit named a block. The block is a set of data with a predetermined size. A file is composed of a plurality of blocks. When data is sent through the host computer, the block size of the data is restricted by for example the size of the buffer memory of the host computer. Thus, the image of a data block on the copy source side becomes different from the image of a data block on the copy destination side. Consequently, an application that uses a block image of a file is adversely affected.
On the other hand, in the case that the protocol that has a data copy command in the command system as with the above-described SCSI system, the problems involved in the method using the host computer (for example, the problems of the waste of the CPU resources and the data transmission speeds) are solved. However, in this case, a block image cannot be stored as it is.
Devices that perform a copy operation are for example a block device (such as a disk unit) and a sequential device (such as a magnetic tape unit). In the block device, logical blocks of data are controlled as the conception of sectors. Thus, the block size is fixed. When data is copied between devices with the same sector length, it is not necessary to consider the block size. In other words, when data is copied between block devices such as disk units, a sector image is simply copied as in many real examples.
On the other hand, in the sequential device, data is recorded as variable length blocks. In other words, the amount of data being recorded varies block by block. As an example, 100 bytes of data, 50 bytes of data, and 1024 bytes of data are recorded in the first data block, the second data block, and the third data block, respectively. The images of blocks vary corresponding to the sizes of data. Thus, when data is copied by sequential devices, it is difficult to handle the variable length blocks.
When data is sent in a computer system, only data is sent. However, management data such as a data size and a block size is not sent. Thus, the data receiving side should create such management data. Since the sequential device cannot determine the block size unless it has read all data because data is sent as variable length blocks, the data may not be correctly sent.
For example, assume a device that has a plurality of data regions and a plurality of block management tables in the buffer memory as shown in FIG. 22. In addition, assume that a block management table stores for example a data start position, information that represents whether or not the data is at the beginning or in the middle of a particular block, the length of data managed by the table, and the full size of blocks. In particular, after all blocks have been sent, the information of the size of all blocks is obtained. Corresponding to the information stored in the block management table, the structure of the entire blocks of data stored in individual data regions is obtained.
In this structure, when a block excluding the block management table is written to the buffer memory, the block can be correctly restored corresponding to information written to the block management table.
However, when blocks that exceed the buffer size are written (namely, when the block size exceeds the buffer size), as shown in FIG. 23, before the block management table is created, the data is sent from the buffer. In addition, even if the block size is smaller than the buffer size, as shown in FIG. 24, when blocks are partly stored in the data region, the similar situation takes place. In this example, when blocks that are larger than 2/5 of the buffer size are sent, the buffer gets overflowed. Thus, before the block management table is created, the data is sent.
This is because data to be sent is composed of variable length blocks, unless all data has been read, the block size cannot be obtained and the available buffer size cannot be assured. Thus, when data is sent from the buffer before the block management table is created, data cannot be accurately restored.